package cn.itheima.service.impl;

import cn.itheima.dao.StandardRepository;
import cn.itheima.domain.Standard;
import cn.itheima.service.StandardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by millions on 2017/7/2.
 */
@Service
public class StandardServiceImpl implements StandardService {

    @Autowired
    private StandardRepository standardRepository;

    @Override
    public List<Standard> findAll() {
        return standardRepository.findAll();
    }

    @Override
    @Transactional
    public void save(Standard standard) {

        standardRepository.save(standard);
    }

    @Override
    public Page<Standard> findByPage(Pageable pageable) {


        return standardRepository.findAll(pageable);
    }
}
